<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>demo</title>
</head>

<body>
<ul>
    <li class="item1">item-1</li>
    <li class="item2">item-2</li>
    <li class="item3">item-3</li>
    <li class="item4">item-4</li>
    <li class="item5">item-5</li>
    <li class="item6">item-6</li>
    <li class="item7">item-7</li>
    <li class="item8">item-8</li>
    <li class="item9">item-9</li>
</ul>
<script src="../vendor/jquery-1.12.4.js"></script>
<script>
    $(function() {

        var elements = $('li');

//        console.log(elements.html()); //只对第一个元素起作用
//        console.log(elements.text()); //获取全部元素

        console.log(elements.html('<strong>123</strong>'));
        //        console.log(elements.text('<strong>123</strong>'));  //将html代码作为文本处理

//        console.log(elements.html('<script>alert("123")<\/script>'));
    });
</script>
</body>

</html>
